/**
 * 
 */
package com.gr.menuw.menu.item;

import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.link.AbstractLink;


/**
 * @author Graham Rhodes 1 Jan 2011 14:15:45
 */
public class AjaxLinkMenuItem extends AbstractMenuLink {

    private static final long serialVersionUID = 1L;
    private final AjaxLink<Void> link;

    public AjaxLinkMenuItem(String id, String label, AjaxLink<Void> link) {
        super(id, label);
        this.link = link;
    }

    /* (non-Javadoc)
     * @see com.gr.menuw.menu.item.AbstractMenuLink#getLink(java.lang.String)
     */
    @Override
    protected AbstractLink getLink(String id) {
        return link;
    }

    public void enabled(boolean enabled) {
        link.setEnabled(enabled);
    }

    /* (non-Javadoc)
     * @see com.gr.menuw.menu.item.IMenuItem#show(boolean)
     */
    @Override
    public void show(boolean visable) {
        link.setVisible(visable);
    }

}
